package com.wlr.study.jvm;

import java.util.ArrayList;
import java.util.List;

public class HeapOOM {
    static class OOMObject {
    }

    private int stackLength = 1;

    public void stackLeak() {
        stackLength++;
        stackLeak();
    }


    public static void main(String[] args) {
        HeapOOM oom = new HeapOOM();
        try {
            oom.stackLeak();
        } catch (Exception e) {
            System.out.println("stack length:" + oom.stackLength);
            e.printStackTrace();
        }
    }
}
